﻿using System;
using System.Collections.Generic;
using System.Linq;

using cit.CopyDetection.DataObject;

namespace cit.CopyDetection.Model
{
    public class LogWtFunc: ILocalWtFunc
    {
        #region ILocalWtScheme Members

        public double Apply(Term term, List<Term> terms)
        {
            Term checkedTerm = terms.FirstOrDefault(t => t.Equals(term));
            return Math.Log(checkedTerm.GlobalFrequency + 1, 2);
        }

        #endregion
    }
}
